import Vue from 'vue';
import App from './App';
import store from "./util/store.js";
import "./util/prototype.js";
import "./util/filter.js";
import {request,uploadImage,uploadImageH5,changeToken} from "./util/request.js"

import { pcaa } from 'area-data-vue'
import 'area-linkage-vue/dist/index.css'
import AreaLinkageVue from 'area-linkage-vue'

import AMapLoader from '@amap/amap-jsapi-loader'
AMapLoader.load({
  key: 'e1f7e5e1a3999cf5c5547868c22a6463'
  , plugins: [
    'AMap.DistrictSearch'
    , 'AMap.Scale'
  ]
}).then(AMap => {
  Vue.prototype.$AMap = AMap
  window.console.log('AMap22', AMap)
})
Vue.use(AMapLoader)
Vue.prototype.$AMapLoader = AMapLoader

import uView from 'uview-ui'
Vue.use(uView);

Vue.prototype.$pcaa = pcaa
Vue.use(AreaLinkageVue)

Vue.config.productionTip = false;

Vue.prototype.$store = store;
Vue.prototype.$req = request;
Vue.prototype.$changeToken = changeToken;
Vue.prototype.$uploadImage = uploadImage;
Vue.prototype.$uploadImageH5 = uploadImageH5;
// Vue.mixin({
	// data(){
		
	// },
	// onLoad() {
	// 	this.overdue()
	// },
	// methods:{
	// 	overdue(){
	// 		console.log('overdue')
	// 		if(uni.getStorageSync('token')){
	// 			uni.reLaunch({
	// 				url:'/src/pages/login/login.vue'
	// 			})
	// 		}else{
	// 			let now_time = new Date().getTime()
	// 			let token_time = uni.getStorageSync('token_refreshtime')*1000 || 0
	// 			if((token_time - now_time)<0){
	// 			  uni.setStorageSync('token','')
	// 			  uni.reLaunch({
	// 			  	url:'/src/pages/login/login.vue'
	// 			  })
	// 			}
	// 		}
	// 	}
	// }
// });

App.mpType = 'app';
if (store.state.globalApi == "http://tonghua.zhihuiwei.vip/api/") {
	console.log = () => {}
}

const app = new Vue({
    ...App
});
app.$mount();

// setInterval(function() {
// 	console.log('changeToken')
// 	Vue.prototype.$changeToken();
// },1000*60*5)

/**
 *      ┌─┐       ┌─┐
 *   ┌──┘ ┴───────┘ ┴──┐
 *   │                 │
 *   │       ───       │
 *   │  ─┬┘       └┬─  │
 *   │                 │
 *   │       ─┴─       │
 *   │                 │
 *   └───┐         ┌───┘
 *       │         │
 *       │         │
 *       │         │
 *       │         └──────────────┐
 *       │                        │
 *       │                        ├─┐
 *       │                        ┌─┘
 *       │                        │
 *       └─┐  ┐  ┌───────┬──┐  ┌──┘
 *         │ ─┤ ─┤       │ ─┤ ─┤
 *         └──┴──┘       └──┴──┘
 *                神兽保佑
 *               代码无BUG!
 */